<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../include/laypublic.jsp" %>
<%@ include file="../include/vueComponent.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>融资尽调详情</title>
</head>
<link rel="stylesheet" href="${ctx}/resources/vue-element-lib/detail.css">
<style>
    .el-form-item__content {
        min-height: 40px;
        line-height: normal;
        display: flex;
        align-items: center;
    }
</style>
<body>
<div id="app">
    <div class="layui-tab layui-tab-brief" lay-filter="xqxx-tab-all">
        <ul class="layui-tab-title">
            <li id="tbglId" class="layui-this" lay-id="0">融资尽调详情</li>
            <li id="zgysId" lay-id="1">历史审批信息</li>
        </ul>
        <div class="layui-tab-right">
            <c:if test="${isAuditFlag eq '1'}">
                <template v-if="layId==0">
                    <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" @click="save(1)">保存
                    </button>
                    <button type="button" class="layui-btn layui-btn-radius" @click="save(2)">提交</button>
                </template>
            </c:if>
            <c:if test="${auditTabFlag eq '1'}">
                <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" @click="audit(0)">
                    不同意
                </button>
                <button type="button" class="layui-btn layui-btn-radius" @click="audit(1)">同意</button>
            </c:if>
        </div>
        <div class="layui-tab-content" style="height: 100px;">
            <div class="layui-tab-item layui-show">
                <div class="container">
                    <el-form ref="formRef" label-width="180px" label-suffix="："
                             label-position="left">
                        <div class="title">
                            <h3>项目基础信息</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目名称">
                                    <span>{{info.proName}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="项目实施单位">
                                    <el-select v-model="info.implementationUnit" style="width: 100%" filterable
                                               placeholder="请选择项目实施单位">
                                        <el-option v-for="item in owner" :key="item.id" :label="item.coopName"
                                                   :value="item.id"></el-option>
                                    </el-select>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目所属行业">
                                    <span>{{proFormat}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="建设内容">
                                    <span>{{info.constructionContent}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目地点">
                                    <span>{{province+city+area}}{{info.proAddress}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="项目类型">
                                    <span>{{info.proTypes==1?'PPP项目':''}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目落地财政级别">
                                    <span>{{cityLevel}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="建设周期(年)">
                                    <span>{{info.buildYears}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="运营周期(年)">
                                    <span>{{info.omYears}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="合作周期(年)">
                                    <span>{{info.workYears}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="回报机制">
                                    <span>{{backMech}}</span>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <div class="title">
                            <h3>项目投资规模</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="设备购置费用(万元)">
                                    <span>{{info.deviceCost}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="建安工程费用(万元)">
                                    <span>{{info.rowSum}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="工程建设其他费用(万元)">
                                    <span>{{info.otherCost}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="预备费(万元)">
                                    <span>{{info.inReadyCost}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="建设期利息(万元)">
                                    <span>{{info.periodInterest}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="投资总额(万元)">
                                    <span>{{info.sumAmount}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>底线标准情况</h3>
                        </div>
                        <div class="unit">
                            <div class="unit_center">
                                <el-table :data="info.baseLineVos" style="width: 100%" border>
                                    <el-table-column prop="standardName" label="标准名称"
                                                     align="center"></el-table-column>
                                    <el-table-column prop="standardCode" label="标准值"
                                                     align="center"></el-table-column>
                                    <el-table-column prop="nowProgress" label="当前进度"
                                                     align="center"></el-table-column>
                                    <el-table-column prop="resultMsg" label="结论" align="center"></el-table-column>
                                </el-table>
                            </div>
                        </div>
                        <div class="title">
                            <h3>政府财政状况</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="入库情况">
                                    <x-select v-model="info.isInStore" :options="storageSituation"
                                              name="入库情况"></x-select>
                                    <%--                                    <span>{{info.isInStore==1?'已入库':'未入库'}}</span>--%>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="政府债务率">
                                    <x-input v-model="info.debtRate" name="政府债务率" type="number" min="0"/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="一般公共预算收入">
                                    <span>{{info.pubIncome}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="是否纳入财政预算的人大决议" label-width="220px">
                                    <x-select v-model="info.fitNpc" :options="yesOrNo"
                                              name="是否纳入财政预算的人大决议"></x-select>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>金融机构信息</h3>
                        </div>
                        <div class="unit">
                            <div class="unit_add">
                                <button class="layui-btn layuiadmin-btn-admin" type="button" data-type="add"
                                        @click="add()">
                                    <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加金融机构
                                </button>
                            </div>
                            <div class="unit_center">
                                <div class="unit_img">
                                    <div class="item" v-for="(item,index) in lookInfoBanks" :key="index"
                                         v-if="lookInfoBanks.length>1">
                                        <img src="${ctx}/resources/images/del.png" alt="" @click="del(index)">
                                    </div>
                                </div>

                                <el-table :data="lookInfoBanks" style="width: 100%" border>
                                    <el-table-column prop="unit" label="机构类型" align="center" width="200">
                                        <template slot-scope="scope">
                                            <el-select v-model="scope.row.bankType" placeholder="请选择"
                                                       @change="changeType(scope.$index)">
                                                <el-option v-for="item in bankType" :key="item.code" :label="item.name"
                                                           :value="item.code"></el-option>
                                            </el-select>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="effect" label="对接银行" align="center" width="200">
                                        <template slot-scope="scope">
                                            <el-select v-model="scope.row.bankName" placeholder="请选择">
                                                <el-option v-for="(item,index) in bankName" :key="item+index"
                                                           :label="item" :value="item"></el-option>
                                            </el-select>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="type" label="对接具体银行" align="center" width="200">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.dockBank" placeholder="请输入对接具体银行"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="type" label="对接人" align="center" width="200">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.dockMan"
                                                      placeholder="对接人"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="type" label="对接人职位" align="center" width="200">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.dockManPost"
                                                      placeholder="对接人职位"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="type" label="对接人联系方式" align="center" width="200">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.dockManLink"
                                                      placeholder="对接人联系方式"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="type" label="沟通内容及建议" align="center" width="200">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.advice"
                                                      placeholder="沟通内容及建议"></el-input>
                                        </template>
                                    </el-table-column>
                                </el-table>


                            </div>
                        </div>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="融资建议">
                                    <x-input v-model="info.advise" type="textarea" :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>项目附件信息</h3>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、图片资料，可上传多个</label>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">附件</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" type="button" id="46-upload-more">上传
                                    </button>
                                    <div class="layui-upload-list" id="46-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </el-form>
                    <c:if test="${auditTabFlag eq '1'}">
                        <div class="title">
                            <h3>审批信息</h3>
                        </div>
                        <%@ include file="process/process-audit.jsp" %>
                    </c:if>
                </div>
            </div>
            <div class="layui-tab-item">
                <%--                <%@ include file="process/process-history.jsp" %>--%>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/resources/vue-element-lib/jquery.js"></script>
<script>
    var fileArr = [];
    var staticPath = '${fileHttpPre}';
    layui.config({
        base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set', 'upload', 'table', 'transfer', 'laydate', 'element', 'layer'], function () {
        var $ = layui.$
            , upload = layui.upload
            , table = layui.table
            , element = layui.element
            , layer = layui.layer;

        //选项卡切换监听
        element.on('tab(xqxx-tab-all)', function (data) {
            var layId = $(this).attr('lay-id');
            vm.$data.layId = layId;
            if (layId === "0") {

            } else if (layId === "1") {
                loadTable(layId);
            }
        });

        function loadTable(layId) {
            // 表单
            table.render({
                elem: '#lay-lsspxx-create-manage'
                , url: basePath + '/historyProcess/list?proCode=${proCode}'
                , cols: [[
                    {
                        field: 'startTime', title: '发起时间', width: 145, width: 155, templet: function (d) {
                            return layui.util.toDateString(d.startTime, "yyyy-MM-dd HH:mm:ss");
                        }
                    }
                    , {field: 'startRealName', title: '发起人', width: 145}
                    , {field: 'proFlowType', title: '审批阶段', width: 145}
                    , {field: 'proFlowNode', title: '审批节点', width: 145}
                    , {
                        field: 'dealTime', title: '审批日期', width: 155, templet: function (d) {
                            return layui.util.toDateString(d.dealTime, "yyyy-MM-dd HH:mm:ss");
                        }
                    }
                    , {field: 'dealName', title: '审批人', width: 160}
                    , {
                        field: 'state', title: '审批状态'
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>查看</a>';
                            return optStr;
                        }
                    }
                ]]
                , page: true
                , limit: 10
            });

            // 监听操作列
            table.on('tool(lay-lsspxx-create-manage)', function (obj) {
                var data = obj.data;
                if (obj.event === 'view') {//查看
                    parent.layui.index.openTabsPage(basePath + '/historyProcess/toDetail?processId=' + data.processId, '历史流程信息 > 详情');
                }
            });
        }

        //多文件列表示例
        ;(function () {
            //定义构造函数
            var Upfile = function (ele, type, opt) {
                this.defaults = {
                    //elem:‘#uploadPic‘	//绑定元素
                    elem: $(ele)	//绑定元素
                    , url: basePath + '/contractInfo/uploadAtt/',
                    data: {
                        types: type
                    },
                    multiple: true,
                    accept: 'file',
                    acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf',

                    method: 'post',
                    before: function (obj) { //obj参数包含的信息
                        layer.load(); //上传loading
                    },
                    done: function (res) {
                        //如果上传失败
                        if (res.code > 0) {
                            layer.closeAll('loading'); //关闭loading
                            return layer.msg(res.msg, {icon: 7});
                        }
                        //上传完毕
                        if (res.entity != null && res.entity.length > 0) {
                            fileArr.push(res.entity[0])
                            for (var i in res.entity) {
                                var contractInfo = res.entity[i];
                                var arr = contractInfo.split("|");
                                var imgSrc = "";
                                var suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                                if (suffix == 'jpg' || suffix == 'png') {
                                    imgSrc = "${fileHttpPre}/" + arr[3];
                                } else {
                                    imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                                }
                                $('#' + type + '-upload-more-list')
                                    .append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="'
                                        + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}"
                                        + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\''
                                        + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="'
                                        + contractInfo + '" id="fileAtt_' + arr[2] + '" name="fileAtts" ></input></div> ');
                            }
                        }
                    },
                    allDone: function (obj) { //当文件全部被提交后，才触发
                        layer.closeAll('loading'); //关闭loading
                    },
                    error: function () {
                        layer.closeAll('loading'); //关闭loading
                        //上传失败
                        layer.msg("上传失败，请稍后再试~", {icon: 7});
                    }
                }
                this.options = $.extend({}, this.defaults, opt);
            };

            //定义方法
            Upfile.prototype = {
                init: function () {
                    var _this = this;
                    return layui.use('upload', function () {
                        var upload = layui.upload;

                        //执行实例
                        var uploadInst = upload.render(_this.options);
                    });
                }
            };

            //在插件中使用对象
            $.fn.upfile = function (options) {
                var upfile = new Upfile(this, options);
                return upfile.init();
            }
        })();
        //上传文件
        $('#46-upload-more').upfile(46);
    });

    //删除文件
    function del(index) {
        layui.$("#fileAtt_" + index).remove();
        layui.$("#upload_img_" + index).remove();
        fileArr.map((el, idx) => {
            if (el.split('|')[2] == index) {
                fileArr.splice(idx, 1)
            }
        })
    }

    //根据url查看文件
    function showImg(url) {
        var openWin = window.open(url, '', 'left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }

    /*核心*/
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                layId: '0',
                id: '',
                processId: '',
                procNodeList: [],
                tempNodeList: [],
                auditMsg: '',//审批意见
                info: {},
                yesOrNo: [],
                lookInfoBanks: [],//金融机构信息列表
                bankType: [],//机构类型
                bankAll: [],//所有银行
                bankName: [],//选中的银行
                owner: [],
                storageSituation: [],//入库情况
                proFormat: '',
                proFormaType: [],//行业
                cityLevel: '',
                cityLevelArr: [],
                backMech: '',
                backMechArr: [],
                province: '',//
                city: '',
                area: '',

            }
        },
        created() {
            this.id = "${id}";
            this.processId = "${processId}";
            this.queryDrop();
            this.queryCoopInfo();
            this.queryProcessList();
        },

        mounted() {

        },
        methods: {
            queryCoopInfo() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/proSell/queryCoopInfo',  //请求数据接口
                    data: {},
                    success: function (result) {
                        that.owner = result;
                    }
                });
            },
            add() {
                let obj = {
                    'bankType': '',//  机构类型
                    'bankName': '',//   对接银行
                    'dockBank': '',//  对接具体银行
                    'dockMan': '',//    对接人
                    'dockManPost': '',//   对接人职位
                    'dockManLink': '',//   对接人联系方式
                    'advice': ''//   沟通内容及建议
                }
                this.lookInfoBanks.push(obj);
            },
            del(index) {
                this.lookInfoBanks.splice(index, 1)
            },
            showChange(e, item) {
                if (e) {
                    this.bankAll.map(el => {
                        if (el.code == item.bankType) {
                            this.bankList.push(el)
                        }
                    })
                } else {
                    this.bankList = [];
                }
            },
            changeType(index) {
                this.lookInfoBanks[index].bankName = '';
            },
            // 详情
            queryLookInfo() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/lookInfo/queryLookInfo',  //请求数据接口
                    data: {id: that.id},
                    success: function (result) {
                        if (result.entity) {
                            that.info = result.entity;
                            that.info.fitNpc += '';
                            that.lookInfoBanks = result.entity.lookInfoBanks;
                            if (that.lookInfoBanks && that.lookInfoBanks.length > 0) {
                                that.lookInfoBanks.map(el => {
                                    el.bankType += ''
                                })
                            }
                            that.arrMap(that.proFormaType, 'proFormat');
                            that.arrMap(that.cityLevelArr, 'cityLevel');
                            that.arrMap(that.backMechArr, 'backMech');
                            that.showFile(result.entity.fileAtt);
                            that.getAddress('', '', result.entity.refProvinceId, 'province');
                            that.getAddress(result.entity.refProvinceId, 1, result.entity.refCityId, 'city');
                            that.getAddress(result.entity.refCityId, 2, result.entity.refAreaId, 'area');
                        }
                    }
                });
            },
            getAddress(id, type = 0, typeId, name) {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/collectProject/getAddress',  //请求数据接口
                    data: {
                        id: (id ? id + ',' : '') + (type ? type : '0')
                    },
                    success: function (result) {
                        if (typeId) {
                            let arr = result.entity;
                            arr.map(el => {
                                if (el.id == typeId) {
                                    that[name] = el.sname;
                                }
                            })
                        }
                    }
                });
            },

            //循环方法
            arrMap(arr, name) {
                let that = this;
                arr.map(el => {
                    if (el.code == that.info[name]) {
                        that[name] = el.name
                    }
                })
            },

            //去重
            deDuplication(arr, key) {
                var result = [];
                var obj = {};
                for (var i = 0; i < arr.length; i++) {
                    if (!obj[arr[i][key]]) {
                        result.push(arr[i]);
                        obj[arr[i][key]] = true;
                    }
                }
                return result;
            },
            queryDrop() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/lookInfoBegin/queryDrop',  //请求数据接口
                    data: {},
                    success: function (result) {
                        if (result.entity) {
                            that.proFormaType = result.entity.proFormaType;
                            that.storageSituation = result.entity.storageSituation;
                            that.yesOrNo = result.entity.yesOrNo;
                            that.cityLevelArr = result.entity.cityLevel;
                            that.backMechArr = result.entity.backMech;
                            that.bankAll = result.entity.bank;//银行列表
                            that.bankName = result.entity.bankName;//银行列表
                            if (result.entity.bank && result.entity.bank.length > 0) {
                                that.bankType = that.deDuplication(result.entity.bank, 'code')
                            }
                            that.queryLookInfo();
                        }
                    }
                });
            },
            error(text) {
                this.$message({
                    message: text,
                    type: 'warning'
                });
            },
            save(type) {
                let that = this;
                if (that.lookInfoBanks && that.lookInfoBanks.length > 0) {
                    for (let i = 0; i < that.lookInfoBanks.length; i++) {
                        if (!that.lookInfoBanks[i].bankType) return that.error('请选择机构类型');
                        if (!that.lookInfoBanks[i].bankName) return that.error('请选择对接银行');
                        if (!that.lookInfoBanks[i].dockBank) return that.error('请输对接具体银行入');
                        if (!that.lookInfoBanks[i].dockMan) return that.error('请输入对接人');
                        if (!that.lookInfoBanks[i].dockManPost) return that.error('请输入对接人职位');
                        if (!that.lookInfoBanks[i].dockManLink) return that.error('请输入对接人联系方式');
                        var myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
                        if (!myreg.test(that.lookInfoBanks[i].dockManLink)) return that.error('请输入正确的对接人联系方式');

                        if (!that.lookInfoBanks[i].advice) return that.error('请输入沟通内容及建议');
                    }
                } else {
                    return that.error('请添加金融机构信息')
                }
                that.info.id = that.id;
                if (!that.info.advise) return that.error('请输入融资建议')
                let obj = {
                    lookInfoDto: that.info,
                    lookInfoBanks: that.lookInfoBanks,
                    fileAtt: fileArr
                };
                let str = JSON.stringify(obj).replace(/\"/g, '\\"');
                $.ajax({
                    type: 'post',
                    url: basePath + '/lookInfo/save',  //请求数据接口
                    async: false,
                    data: {
                        bodyStr: str,
                        submitType: type,
                    },
                    success: function (result) {
                        if (result.success) {
                            that.$message({
                                message: '保存成功',
                                type: 'success'
                            });
                            setTimeout(function () {
                                // 刷新首页
                                let index = window.parent.layui.admin.tabsPage.index
                                if (index == null) {
                                    window.close();
                                } else {
                                    var iframe = window.parent.layui.admin.tabsBody((index - 1)).find(".layadmin-iframe");
                                    iframe[0].contentWindow.location.reload();
                                    top.layui.admin.closeThisTabs(); // 关闭当前标签页
                                }
                            }, 3000);
                        } else {
                            that.$message.error(result.msg);
                        }
                    }
                });

            },
            // proSell/queryCoopInfo
            showFile(fileList) {
                if (fileList && fileList.length > 0) {
                    fileArr = fileList;
                    for (let i in fileList) {
                        let contractInfo = fileList[i];
                        let arr = contractInfo.split("|");
                        let imgSrc = "";
                        let suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                        if (suffix == 'jpg' || suffix == 'png') {
                            imgSrc = "${fileHttpPre}/" + arr[3];
                        } else {
                            imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                        }
                        $('#' + arr[0] + '-upload-more-list')
                            .append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="'
                                + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}"
                                + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\''
                                + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="'
                                + contractInfo + '" id="fileAtt_' + arr[2] + '" name="fileAtts" ></input></div> ');
                    }
                }
            },

            queryProcessList() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/capHistoryProcess/processList',  //请求数据接口
                    data: {processId: that.processId},
                    success: function (result) {
                        if (result.success) {
                            that.procNodeList = result.entity.procNodeList;
                            that.tempNodeList = result.entity.tempNodeList;
                        }
                    }
                });
            },

            audit(status) {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/lookInfo/auditProcess',  //请求数据接口
                    async: false,
                    data: {
                        id: that.id,
                        processId: that.processId,
                        status: status,
                        auditMsg: that.auditMsg
                    },
                    success: function (result) {
                        if (result.success) {
                            that.$message({
                                message: '操作成功',
                                type: 'success'
                            });
                            setTimeout(function () {
                                // 刷新首页
                                let index = window.parent.layui.admin.tabsPage.index
                                if (index == null) {
                                    window.close();
                                } else {
                                    var iframe = window.parent.layui.admin.tabsBody((index - 1)).find(".layadmin-iframe");
                                    iframe[0].contentWindow.location.reload();
                                    top.layui.admin.closeThisTabs(); // 关闭当前标签页
                                }
                            }, 3000);
                        } else {
                            that.$message.error('保存失败');
                        }
                    }
                });
            }
        }
    })
</script>
</body>
</html>

